package cn.kgc.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 课工场
 * @date 2024/7/25
 * @description
 */
@RestController
@RequestMapping("nacos2")
@RefreshScope
public class NacosClient2Controller {


    @Value("${server.port}")
    private String port;

    @Value("${name}")
    private String name;
    @Value("${age}")
    private Integer age;

    @GetMapping("m1")
    public String method1() {
        return "NacosClient2Controller ok  port =  " + port;
    }

    @GetMapping("m2")
    public String method2() {
        return "NacosClient2Controller ok name =  " + name+",age="+age;
    }
}